import java.math.*;
public class Chemical 
{
	private String chemicalName;
	private double chemicalConc;
	private double volume;
	private double molecularWeight;
	private BigDecimal decimalAmount;
	
	public Chemical ()
	{
		chemicalName = "";
		chemicalConc = 0.0;
		volume = 0.0;
		molecularWeight = 0; 
		
	}
	public Chemical (String chemicalName, double chemicalConc, double volume, double molecularWeight )
	{
		this.chemicalName = chemicalName;
		this.chemicalConc = chemicalConc;
		this.volume = volume;
		this.molecularWeight = molecularWeight;
		double amount = chemicalConc * volume * molecularWeight / 1000;
		// format the result with 2 decimal
		BigDecimal decimalAmount = new BigDecimal (Double.toString(amount));  //wrap it as double, change to string
		decimalAmount = decimalAmount.setScale(2, RoundingMode.HALF_UP);
		this.decimalAmount = decimalAmount;
		
	}
	public String getChemicalName (Chemical c)
	{
		return chemicalName;
	}
	public double getChemicalConc (Chemical c)
	{
		return chemicalConc;
	}
	public double getVolume (Chemical c)
	{
		return volume;
	}
	public double getMolecularWeight (Chemical c)
	{
		return molecularWeight;
	}
	public BigDecimal getDecimalAmount (Chemical c)
	{
		return decimalAmount;
	}
}
